package view;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.util.ArrayList;

import javax.swing.JPanel;

import modle.Shape;

public class DrawPanel extends JPanel {
	private ArrayList<Shape> list = new ArrayList<Shape>();
	
	public DrawPanel(int width, int height) {
		setSize(new Dimension(width, height));
		setBackground(Color.WHITE);
	}
	
	public ArrayList<Shape> getShapeList(){
		return this.list;
	}
	
	@Override
	protected void paintComponent(Graphics g) {
		super.paintComponent(g);
		for(Shape shape : list) {
			shape.draw((Graphics2D)g);
//			shape.draw(this);
		}
	}
}
